<template>
  <el-table
    :data="tableData"
    stripe
    height="350px"
    highlight-current-row
  >
    <el-table-column
      prop="name"
      label="模型名称"
      align="left"
      sortable
    />
    <el-table-column
      prop="createTime"
      label="最近更新"
      align="left"
      width="160px"
      sortable
    />
    <el-table-column
      prop="statusName"
      label="状态"
      align="left"
      width="80px"
    >
      <template slot-scope="scope">
        <el-button
          type="text"
          :class="scope.row.status === 3 ? 'green' : scope.row.status === 2 ?'blue':scope.row.status === -1 ?'lightRed':scope.row.status === 1 ?'lightBlue':scope.row.status === -2 ?'red':'unKnow'"
        >{{ scope.row.statusName }}
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</template>
<script>
import { allModelList } from '@/api/project/projectSub'

export default {
  props: {
    childParams: {
      type: Object,
      default() {
        return {
          title: '转换状态',
          type: Object
        }
      }
    }
  },
  data() {
    return {
      tableData: [] // 表格数据
    }
  },
  methods: {
    /* 获取状态信息*/
    getStatus(row) {
      this.tableData = []
      const params = { projectCode: row.project.code, unitCode: row.subNo }
      allModelList(params).then(data => {
        if (data.code === 0) {
          this.tableData = data.data
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
.unKnow{
  color: lightslategrey;
}
.lightRed{
  color: #fb8c00;
}
.red {
  color: red;
}
.green {
  color: #52C41A;
}
.blue{
  color: #00a0e9;
}
.lightBlue{
  color: #317ef3;
}
</style>

<style lang="scss">
.abow_dialog[view] {
  .el-dialog {
    line-height: 24px;
    font-style: revert;
    width: 500px;
    max-height: 90%;
    height: auto;
    padding: 0;
    .el-dialog__title{
      font-size: 18px;
      color: var(--brother-common-tips-text-color);
    }
    .el-dialog__header{
      padding: 10px;
    }
    .el-dialog__body{
      padding: 20px 10px 0 10px;
    }
  }
}
</style>
